home *** CD-ROM | disk | FTP | other *** search
/ PC Format 25 / PCFormat 1993-10.iso / UTILS.ZIP / CHKXPATH.BAT < prev    next >
DOS Batch File  |  1992-05-20  |  1KB  |  36 lines

  1. @echo off
  2. if exist *.$X$ del *.$X$
  3. if "%1"=="" goto help
  4. if not exist %1 goto no_file
  5. rem>FILE.$X$
  6. goto end
  7. :no_file
  8. if exist %1\chkxpath.nul goto subdir
  9. ctty nul
  10. rem>%1\chkxpath.nul
  11. ctty con
  12. if not exist %1\chkxpath.nul goto no_subdir
  13. del %1\chkxpath.nul >nul
  14. :subdir
  15. if exist %1\*.* goto fill-dir
  16. rem>EMPTYDIR.$X$
  17. goto end
  18. :fill-dir
  19. rem>FILL-DIR.$X$
  20. goto end
  21. :no_subdir
  22. rem>NONE.$X$
  23. goto end
  24. :help
  25. echo CHKXPATH by Jim Groeneveld, NL, 20/5-92.
  26. echo Checks existence (or not) of some name as a disk file or subdirectory.
  27. echo Syntax: CHKXPATH name
  28. echo in which 'name' may be any combination of drive:path without trailing '\'.
  29. echo To check a root dir of some drive use '\.' or 'd:\.' .
  30. echo Output: one of the following zero-length files in the current subdir:
  31. echo         FILE.$X$            if 'name' exists as a FILE
  32. echo         FILL-DIR.$X$        if 'name' exists as a NON-EMPTY (SUB)DIR
  33. echo         EMPTYDIR.$X$        if 'name' exists as an EMPTY (SUB)DIR
  34. echo         NONE.$X$            if 'name' does NOT exist
  35. :end
  36.